package com.example.christina.repository;

import com.example.christina.enity.Shopcart;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface ShopcartRepository extends JpaRepository<Shopcart, Integer> {

    // 返回购买商品所能获得的积分
    @Query(value = "select goodnumber from Shopcart g where g.goodname=?1")
    Integer find(String goodname);

    List<?> findByusername(String username);

}
